package org.gdstash.character;

import org.gdstash.file.GDReader;
import org.gdstash.file.GDWriter;
import org.gdstash.util.FileVersionException;
import org.gdstash.util.GDMsgFormatter;

import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class GDCharTeleportList {
    private static final byte[] RIFTGATE_01_DEVILS_CROSSING;
    private static final byte[] RIFTGATE_01_LOWER_CROSSING;
    private static final byte[] RIFTGATE_01_WIGHTMIRE;
    private static final byte[] RIFTGATE_01_FOGGY_BANK;
    private static final byte[] RIFTGATE_01_FLOODED_PASSAGE;
    private static final byte[] RIFTGATE_01_BURRWITCH_OUTSKIRTS;
    private static final byte[] RIFTGATE_01_BURRWITCH_VILLAGE;
    private static final byte[] RIFTGATE_01_WARDENS_CELLAR;
    private static final byte[] RIFTGATE_01_UNDERGROUND_TRANSIT;
    private static final byte[] RIFTGATE_01_WARDENS_LABORATORY;
    private static final byte[] RIFTGATE_02_ARKOVIAN_FOOTHILLS;
    private static final byte[] RIFTGATE_02_OLD_ARKOVIA;
    private static final byte[] RIFTGATE_02_CRONLEYS_HIDEOUT;
    private static final byte[] RIFTGATE_02_TWIN_FALLS;
    private static final byte[] RIFTGATE_02_BROKEN_HILLS;
    private static final byte[] RIFTGATE_02_SMUGGLERS_PASS;
    private static final byte[] RIFTGATE_03_DEADMANS_GULCH;
    private static final byte[] RIFTGATE_03_PROSPECTORS_TRAIL;
    private static final byte[] RIFTGATE_03_PINE_BARRENS;
    private static final byte[] RIFTGATE_03_HOMESTEAD;
    private static final byte[] RIFTGATE_03_ROTTING_CROPLANDS;
    private static final byte[] RIFTGATE_03_SORROWS_BASTION;
    private static final byte[] RIFTGATE_03_BLOOD_GROVE;
    private static final byte[] RIFTGATE_03_DARKVALE_GATE;
    private static final byte[] RIFTGATE_04_ASTERKARN_MOUNTAINS;
    private static final byte[] RIFTGATE_04_ASTERKARN_ROAD;
    private static final byte[] RIFTGATE_04_ASTERKARN_VALLEY;
    private static final byte[] RIFTGATE_04_FORT_IKON;
    private static final byte[] RIFTGATE_04_GATES_OF_NECROPOLIS;
    private static final byte[] RIFTGATE_04_NECROPOLIS_INTERIOR;
    private static final byte[] RIFTGATE_05_GLOOMWALD;
    private static final byte[] RIFTGATE_05_GLOOMWALD_CROSSING;
    private static final byte[] RIFTGATE_05_COVENS_REFUGE;
    private static final byte[] RIFTGATE_05_UGDENBOG;
    private static final byte[] RIFTGATE_05_BARROWHOLM;
    private static final byte[] RIFTGATE_05_LONE_WATCH;
    private static final byte[] RIFTGATE_05_MALMOUTH_OUTSKIRTS;
    private static final byte[] RIFTGATE_05_MALMOUTH_SEWERS;
    private static final byte[] RIFTGATE_05_MALMOUTH_STEELCAP;
    private static final byte[] RIFTGATE_05_MALMOUTH_CROWN_HILL;
    private static final byte[] RIFTGATE_06_CONCLAVE_THREE;
    private static final byte[] RIFTGATE_06_KORVAN_PLATEAU;
    private static final byte[] RIFTGATE_06_TEMPLE_OSYR;
    private static final byte[] RIFTGATE_06_KORVAN_SANDS;
    private static final byte[] RIFTGATE_06_CAIRAN_DOCKS;
    private static final byte[] RIFTGATE_06_SUNBANE_OASIS;
    private static final byte[] RIFTGATE_06_VANGUARD_THREE;
    private static final byte[] RIFTGATE_06_RUINS_ABYD;
    private static final byte[] RIFTGATE_06_INFERNAL_WASTES;
    private static final byte[] RIFTGATE_06_KORVAN_CITY;
    private static final byte[] RIFTGATE_06_ELDRITCH_SUN;
    private static final byte[] RIFTGATE_06_ELDRITCH_GATE;
    private static final byte[] RIFTGATE_06_LOST_OASIS;
    public static final GDCharUID UID_RIFT_01_DEVILS_CROSSING;
    public static final GDCharUID UID_RIFT_01_LOWER_CROSSING;
    public static final GDCharUID UID_RIFT_01_WIGHTMIRE;
    public static final GDCharUID UID_RIFT_01_FOGGY_BANK;
    public static final GDCharUID UID_RIFT_01_FLOODED_PASSAGE;
    public static final GDCharUID UID_RIFT_01_BURRWITCH_OUTSKIRTS;
    public static final GDCharUID UID_RIFT_01_BURRWITCH_VILLAGE;
    public static final GDCharUID UID_RIFT_01_WARDENS_CELLAR;
    public static final GDCharUID UID_RIFT_01_UNDERGROUND_TRANSIT;
    public static final GDCharUID UID_RIFT_01_WARDENS_LABORATORY;
    public static final GDCharUID UID_RIFT_02_ARKOVIAN_FOOTHILLS;
    public static final GDCharUID UID_RIFT_02_OLD_ARKOVIA;
    public static final GDCharUID UID_RIFT_02_CRONLEYS_HIDEOUT;
    public static final GDCharUID UID_RIFT_02_TWIN_FALLS;
    public static final GDCharUID UID_RIFT_02_BROKEN_HILLS;
    public static final GDCharUID UID_RIFT_02_SMUGGLERS_PASS;
    public static final GDCharUID UID_RIFT_03_DEADMANS_GULCH;
    public static final GDCharUID UID_RIFT_03_PROSPECTORS_TRAIL;
    public static final GDCharUID UID_RIFT_03_PINE_BARRENS;
    public static final GDCharUID UID_RIFT_03_HOMESTEAD;
    public static final GDCharUID UID_RIFT_03_ROTTING_CROPLANDS;
    public static final GDCharUID UID_RIFT_03_SORROWS_BASTION;
    public static final GDCharUID UID_RIFT_03_BLOOD_GROVE;
    public static final GDCharUID UID_RIFT_03_DARKVALE_GATE;
    public static final GDCharUID UID_RIFT_04_ASTERKARN_MOUNTAINS;
    public static final GDCharUID UID_RIFT_04_ASTERKARN_ROAD;
    public static final GDCharUID UID_RIFT_04_ASTERKARN_VALLEY;
    public static final GDCharUID UID_RIFT_04_FORT_IKON;
    public static final GDCharUID UID_RIFT_04_GATES_OF_NECROPOLIS;
    public static final GDCharUID UID_RIFT_04_NECROPOLIS_INTERIOR;
    public static final GDCharUID UID_RIFT_05_GLOOMWALD;
    public static final GDCharUID UID_RIFT_05_GLOOMWALD_CROSSING;
    public static final GDCharUID UID_RIFT_05_COVENS_REFUGE;
    public static final GDCharUID UID_RIFT_05_UGDENBOG;
    public static final GDCharUID UID_RIFT_05_BARROWHOLM;
    public static final GDCharUID UID_RIFT_05_LONE_WATCH;
    public static final GDCharUID UID_RIFT_05_MALMOUTH_OUTSKIRTS;
    public static final GDCharUID UID_RIFT_05_MALMOUTH_SEWERS;
    public static final GDCharUID UID_RIFT_05_MALMOUTH_STEELCAP;
    public static final GDCharUID UID_RIFT_05_MALMOUTH_CROWN_HILL;
    public static final GDCharUID UID_RIFT_06_CONCLAVE_THREE;
    public static final GDCharUID UID_RIFT_06_KORVAN_PLATEAU;
    public static final GDCharUID UID_RIFT_06_TEMPLE_OSYR;
    public static final GDCharUID UID_RIFT_06_KORVAN_SANDS;
    public static final GDCharUID UID_RIFT_06_CAIRAN_DOCKS;
    public static final GDCharUID UID_RIFT_06_SUNBANE_OASIS;
    public static final GDCharUID UID_RIFT_06_VANGUARD_THREE;
    public static final GDCharUID UID_RIFT_06_RUINS_ABYD;
    public static final GDCharUID UID_RIFT_06_INFERNAL_WASTES;
    public static final GDCharUID UID_RIFT_06_KORVAN_CITY;
    public static final GDCharUID UID_RIFT_06_ELDRITCH_SUN;
    public static final GDCharUID UID_RIFT_06_ELDRITCH_GATE;
    public static final GDCharUID UID_RIFT_06_LOST_OASIS;
    public static final GDCharUID UID_RIFT_07_FROSTRVEIL_HIGHLANDS;
    public static final GDCharUID UID_RIFT_07_ICEBOUND_PASSAGE;
    public static final GDCharUID UID_RIFT_07_FREYOLL_VALLEY;
    public static final GDCharUID UID_RIFT_07_KURNHOLD;
    public static final GDCharUID UID_RIFT_07_ULOS_SPRINGS;
    public static final GDCharUID UID_RIFT_07_DREAD_WASTES;
    public static final GDCharUID UID_RIFT_07_BLOOD_FIELDS;
    public static final GDCharUID UID_RIFT_07_GLACIERS_EDGE;
    public static final GDCharUID UID_RIFT_07_AURORA_PEAKS;
    public static final GDCharUID UID_RIFT_07_GLACIAL_GROTTO;
    public static final GDCharUID UID_RIFT_07_ROOF_WORLDN;
    public static final GDCharUID UID_RIFT_07_DRANG_SUL_LOW;
    public static final GDCharUID UID_RIFT_07_DRANG_GAL_HIGH;
    public static final GDCharUID UID_RIFT_ROT_01_ROGUE_ENCAMPMENT;
    private static final byte[] RIFTGATE_ROT_01_ROGUE_ENCAMPMENT;
    private static final byte[] RIFTGATE_ROT_01_COLD_PLAINS;
    private static final byte[] RIFTGATE_ROT_01_STONY_FIELD;
    private static final byte[] RIFTGATE_ROT_01_DARK_WOOD;
    private static final byte[] RIFTGATE_ROT_01_BLACK_MARSH;
    private static final byte[] RIFTGATE_ROT_01_CLOISTER_OUTER;
    private static final byte[] RIFTGATE_ROT_01_JAIL;
    private static final byte[] RIFTGATE_ROT_01_CLOISTER_INNER;
    private static final byte[] RIFTGATE_ROT_01_CATACOMBS;
    private static final byte[] RIFTGATE_ROT_02_LUT_GHOLEIN;
    private static final byte[] RIFTGATE_ROT_02_SEWERS;
    private static final byte[] RIFTGATE_ROT_02_DRY_HILLS;
    private static final byte[] RIFTGATE_ROT_02_HALLS_DEAD;
    private static final byte[] RIFTGATE_ROT_02_FAR_OASIS;
    private static final byte[] RIFTGATE_ROT_02_LOST_CITY;
    private static final byte[] RIFTGATE_ROT_02_PALACE_CELLAR;
    private static final byte[] RIFTGATE_ROT_02_ARCANE_SANCTUARY;
    private static final byte[] RIFTGATE_ROT_02_CANYON_MAGI;
    private static final byte[] RIFTGATE_ROT_03_KURAST_DOCKS;
    private static final byte[] RIFTGATE_ROT_03_SPIDER_FOREST;
    private static final byte[] RIFTGATE_ROT_03_GREAT_MARSH;
    private static final byte[] RIFTGATE_ROT_03_FLAYER_JUNGLE;
    private static final byte[] RIFTGATE_ROT_03_KURAST_LOWER;
    private static final byte[] RIFTGATE_ROT_03_KURAST_BAZAAR;
    private static final byte[] RIFTGATE_ROT_03_KURAST_UPPER;
    private static final byte[] RIFTGATE_ROT_03_TRAVINCAL;
    private static final byte[] RIFTGATE_ROT_03_DURANCE_HATE;
    private static final byte[] RIFTGATE_ROT_04_PANDEMONIUM_FORTRESS;
    private static final byte[] RIFTGATE_ROT_04_PLAINS_DESPAIR;
    private static final byte[] RIFTGATE_ROT_04_CITY_DAMNED;
    private static final byte[] RIFTGATE_ROT_04_RIVER_FLAME;
    private static final byte[] RIFTGATE_ROT_05_HARROGATH;
    private static final byte[] RIFTGATE_ROT_05_FRIGID_HIGHLANDS;
    private static final byte[] RIFTGATE_ROT_05_ARREAT_PLATEAU;
    private static final byte[] RIFTGATE_ROT_05_CRYSTALLINE_PASSAGE;
    private static final byte[] RIFTGATE_ROT_05_HALLS_PAIN;
    private static final byte[] RIFTGATE_ROT_05_GLACIAL_TRAIL;
    private static final byte[] RIFTGATE_ROT_05_FROZEN_TUNDRA;
    private static final byte[] RIFTGATE_ROT_05_ANCIENTS_WAY;
    private static final byte[] RIFTGATE_ROT_05_WORLDSTONE_KEEP;
    private static final byte[] RIFTGATE_ROT_06_SHATTERED_CONCLAVE;
    public static final GDCharUID UID_RIFT_ROT_01_COLD_PLAINS;
    public static final GDCharUID UID_RIFT_ROT_01_STONY_FIELD;
    public static final GDCharUID UID_RIFT_ROT_01_DARK_WOOD;
    public static final GDCharUID UID_RIFT_ROT_01_BLACK_MARSH;
    public static final GDCharUID UID_RIFT_ROT_01_CLOISTER_OUTER;
    public static final GDCharUID UID_RIFT_ROT_01_JAIL;
    public static final GDCharUID UID_RIFT_ROT_01_CLOISTER_INNER;
    public static final GDCharUID UID_RIFT_ROT_01_CATACOMBS;
    public static final GDCharUID UID_RIFT_ROT_02_LUT_GHOLEIN;
    public static final GDCharUID UID_RIFT_ROT_02_SEWERS;
    public static final GDCharUID UID_RIFT_ROT_02_DRY_HILLS;
    public static final GDCharUID UID_RIFT_ROT_02_HALLS_DEAD;
    public static final GDCharUID UID_RIFT_ROT_02_FAR_OASIS;
    public static final GDCharUID UID_RIFT_ROT_02_LOST_CITY;
    public static final GDCharUID UID_RIFT_ROT_02_PALACE_CELLAR;
    public static final GDCharUID UID_RIFT_ROT_02_ARCANE_SANCTUARY;
    public static final GDCharUID UID_RIFT_ROT_02_CANYON_MAGI;
    public static final GDCharUID UID_RIFT_ROT_03_KURAST_DOCKS;
    public static final GDCharUID UID_RIFT_ROT_03_SPIDER_FOREST;
    public static final GDCharUID UID_RIFT_ROT_03_GREAT_MARSH;
    public static final GDCharUID UID_RIFT_ROT_03_FLAYER_JUNGLE;
    public static final GDCharUID UID_RIFT_ROT_03_KURAST_LOWER;
    public static final GDCharUID UID_RIFT_ROT_03_KURAST_BAZAAR;
    public static final GDCharUID UID_RIFT_ROT_03_KURAST_UPPER;
    public static final GDCharUID UID_RIFT_ROT_03_TRAVINCAL;
    public static final GDCharUID UID_RIFT_ROT_03_DURANCE_HATE;
    public static final GDCharUID UID_RIFT_ROT_04_PANDEMONIUM_FORTRESS;
    public static final GDCharUID UID_RIFT_ROT_04_PLAINS_DESPAIR;
    public static final GDCharUID UID_RIFT_ROT_04_CITY_DAMNED;
    public static final GDCharUID UID_RIFT_ROT_04_RIVER_FLAME;
    public static final GDCharUID UID_RIFT_ROT_05_HARROGATH;
    public static final GDCharUID UID_RIFT_ROT_05_FRIGID_HIGHLANDS;
    public static final GDCharUID UID_RIFT_ROT_05_ARREAT_PLATEAU;
    public static final GDCharUID UID_RIFT_ROT_05_CRYSTALLINE_PASSAGE;
    public static final GDCharUID UID_RIFT_ROT_05_HALLS_PAIN;
    public static final GDCharUID UID_RIFT_ROT_05_GLACIAL_TRAIL;
    public static final GDCharUID UID_RIFT_ROT_05_FROZEN_TUNDRA;
    public static final GDCharUID UID_RIFT_ROT_05_ANCIENTS_WAY;
    public static final GDCharUID UID_RIFT_ROT_05_WORLDSTONE_KEEP;
    public static final GDCharUID UID_RIFT_ROT_06_SHATTERED_CONCLAVE;
    public static final GDCharUID UID_RIFT_ROT_06_TRISTRAM;
    public static final GDCharUID UID_RIFT_ROT_06_LEVEL_02;
    public static final GDCharUID UID_RIFT_ROT_06_LEVEL_04;
    public static final GDCharUID UID_RIFT_ROT_06_LEVEL_06;
    public static final GDCharUID UID_RIFT_ROT_06_LEVEL_08;
    public static final GDCharUID UID_RIFT_ROT_06_LEVEL_10;
    public static final GDCharUID UID_RIFT_ROT_06_LEVEL_12;
    public static final GDCharUID UID_RIFT_ROT_06_LEVEL_14;
    public static final GDCharUID UID_RIFT_ROT_06_LEVEL_16;
    public static final GDCharUID UID_RIFT_ROT_06_HORADRIM_TOMB;
    private static final byte[] RIFTGATE_07_LOST_OASIS;
    private static final byte[] RIFTGATE_ROT_06_TRISTRAM;
    private static final byte[] RIFTGATE_ROT_06_LEVEL_02;
    private static final byte[] RIFTGATE_ROT_06_LEVEL_04;
    private static final byte[] RIFTGATE_ROT_06_LEVEL_06;
    private static final byte[] RIFTGATE_ROT_06_LEVEL_08;
    private static final byte[] RIFTGATE_ROT_06_LEVEL_10;
    private static final byte[] RIFTGATE_ROT_06_LEVEL_12;
    private static final byte[] RIFTGATE_ROT_06_LEVEL_14;
    private static final byte[] RIFTGATE_ROT_06_LEVEL_16;
    private static final byte[] RIFTGATE_ROT_06_HORADRIM_TOMB;
    private static final int VERSION = 1;
    private static final int BLOCK = 6;

    static {
        RIFTGATE_01_DEVILS_CROSSING = new byte[]{-73, 127, 11, -128, 41, 79, -108, -10, 80, 105, -9, -73, -41, 108, -25, 83};
        RIFTGATE_01_LOWER_CROSSING = new byte[]{37, 51, -100, -49, -33, 66, -113, 56, -86, -2, -24, -100, 16, -26, -111, 63};
        RIFTGATE_01_WIGHTMIRE = new byte[]{-13, -19, 78, 35, -40, 79, -103, 113, 65, -93, -125, -123, -102, 38, -62, 82};
        RIFTGATE_01_FOGGY_BANK = new byte[]{88, 48, 20, -29, 54, 68, -5, -14, 105, 2, -65, -102, -63, -117, -123, -18};
        RIFTGATE_01_FLOODED_PASSAGE = new byte[]{46, 69, -87, -24, 60, 70, -125, 6, 23, 43, 40, -121, -94, 4, -19, -67};
        RIFTGATE_01_BURRWITCH_OUTSKIRTS = new byte[]{59, 104, 21, -5, 28, 73, -91, -126, -93, -38, 35, -66, 72, -57, 105, -128};
        RIFTGATE_01_BURRWITCH_VILLAGE = new byte[]{-36, -37, 64, 110, 94, 68, -66, -54, 71, 90, -92, -103, 5, 28, -42, -91};
        RIFTGATE_01_WARDENS_CELLAR = new byte[]{-99, 46, -79, -109, 90, 74, -74, 58, -8, 43, -56, -83, -81, 81, -120, 46};
        RIFTGATE_01_UNDERGROUND_TRANSIT = new byte[]{-127, -73, 112, -94, -17, 65, 124, -81, -52, 60, -91, -89, 73, -3, 71, 31};
        RIFTGATE_01_WARDENS_LABORATORY = new byte[]{-62, -125, 9, -98, -104, 73, 121, -2, 10, 49, -75, -119, 107, -24, 2, 12};
        RIFTGATE_02_ARKOVIAN_FOOTHILLS = new byte[]{10, -22, -72, 54, 51, 77, 80, 120, -70, 12, -124, -94, -28, -95, 7, 64};
        RIFTGATE_02_OLD_ARKOVIA = new byte[]{-64, -6, -112, -77, 45, 67, 94, 114, 39, -65, -76, -125, 58, 73, 109, 32};
        RIFTGATE_02_CRONLEYS_HIDEOUT = new byte[]{110, 114, -67, -69, -102, 72, 44, -84, 94, 49, 62, -80, 94, 85, -83, 16};
        RIFTGATE_02_TWIN_FALLS = new byte[]{107, -71, -120, -46, -92, 78, 37, 120, 97, -44, 29, -128, -107, 69, 34, 6};
        RIFTGATE_02_BROKEN_HILLS = new byte[]{-97, -79, 6, 41, -106, 68, 99, -31, 4, 72, -67, -99, 71, 115, -62, 100};
        RIFTGATE_02_SMUGGLERS_PASS = new byte[]{32, 53, 77, -34, 50, 72, 44, 121, -22, -85, -78, -73, -81, 96, -74, -16};
        RIFTGATE_03_DEADMANS_GULCH = new byte[]{-14, -31, -39, -62, -23, 68, -63, 114, 113, -101, -110, -108, 11, 95, -120, -110};
        RIFTGATE_03_PROSPECTORS_TRAIL = new byte[]{19, 3, 65, 61, -24, 78, -85, -111, 52, -46, -59, -127, -55, 71, -30, 26};
        RIFTGATE_03_PINE_BARRENS = new byte[]{86, -88, 102, 123, 48, 77, 127, 84, -46, -66, 110, -95, 114, 51, -29, -42};
        RIFTGATE_03_HOMESTEAD = new byte[]{-9, 24, -59, -22, 107, 76, -34, 41, 77, -59, -110, -122, -52, 64, 40, -28};
        RIFTGATE_03_ROTTING_CROPLANDS = new byte[]{100, 101, -27, 60, -68, 75, 37, -54, -111, 79, 86, -100, 47, 49, -85, 116};
        RIFTGATE_03_SORROWS_BASTION = new byte[]{-36, 28, 70, 46, -14, 74, 121, -117, -19, -83, -35, -68, -63, -64, -3, 9};
        RIFTGATE_03_BLOOD_GROVE = new byte[]{-93, 35, 13, -126, 15, 75, -109, 15, -92, -72, 66, -102, -53, -20, 103, -86};
        RIFTGATE_03_DARKVALE_GATE = new byte[]{-58, -25, -106, 71, 91, 79, -20, -96, -37, 42, -1, -105, 112, 60, 91, -47};
        RIFTGATE_04_ASTERKARN_MOUNTAINS = new byte[]{-37, 49, -54, -17, 99, 76, 93, -123, 46, -116, 123, -70, 119, -24, 0, 42};
        RIFTGATE_04_ASTERKARN_ROAD = new byte[]{104, -114, 40, -115, 125, 64, -5, 90, 43, 90, -28, -88, 126, -3, -71, -110};
        RIFTGATE_04_ASTERKARN_VALLEY = new byte[]{-69, -46, -124, -43, 31, 69, 28, -108, 61, -31, -13, -123, -46, 60, -46, 5};
        RIFTGATE_04_FORT_IKON = new byte[]{-61, 63, 25, 71, -116, 76, 39, 56, -74, -20, 15, -108, 101, 21, 100, -2};
        RIFTGATE_04_GATES_OF_NECROPOLIS = new byte[]{100, -58, -44, -52, 21, 64, 93, 9, 27, -64, 5, -127, 10, 13, 30, -30};
        RIFTGATE_04_NECROPOLIS_INTERIOR = new byte[]{-42, -11, -58, 19, 58, 70, -107, -89, -95, 85, 103, -82, -32, -1, -37, -61};
        RIFTGATE_05_GLOOMWALD = new byte[]{-46, 102, -1, -19, 115, 79, -73, 39, -74, 15, -8, -92, -95, -83, -22, 9};
        RIFTGATE_05_GLOOMWALD_CROSSING = new byte[]{47, -72, 51, 40, -85, 75, 61, 119, 25, -59, -17, -109, 97, -25, -8, 99};
        RIFTGATE_05_COVENS_REFUGE = new byte[]{-105, 61, 10, 53, 120, 66, -96, -97, -110, -123, -2, -66, 56, -69, -13, -2};
        RIFTGATE_05_UGDENBOG = new byte[]{-69, -42, 43, -85, -6, 73, -66, -60, -47, -18, 87, -99, 68, 50, -28, -82};
        RIFTGATE_05_BARROWHOLM = new byte[]{-76, 76, -88, 81, -79, 71, 4, 86, 94, -79, -1, -110, 95, 14, 96, 49};
        RIFTGATE_05_LONE_WATCH = new byte[]{-5, -47, -50, 94, 78, 70, 75, 85, -102, 1, -26, -123, 9, -82, -5, 17};
        RIFTGATE_05_MALMOUTH_OUTSKIRTS = new byte[]{-126, 33, -49, -109, 53, 65, 72, -31, 125, 119, -35, -80, 97, -7, -62, 50};
        RIFTGATE_05_MALMOUTH_SEWERS = new byte[]{-1, -93, 103, -127, -45, 69, 95, -53, 110, 82, -116, -77, -71, 94, 79, 107};
        RIFTGATE_05_MALMOUTH_STEELCAP = new byte[]{41, 21, 58, -35, 84, 70, 80, 87, -49, -45, -108, -72, 43, 73, 77, -96};
        RIFTGATE_05_MALMOUTH_CROWN_HILL = new byte[]{-85, 55, 74, 122, -124, 76, -40, -52, -80, -67, 121, -66, 19, 127, 9, -94};
        RIFTGATE_06_CONCLAVE_THREE = new byte[]{-100, 104, -45, 84, 119, 65, 126, -49, 48, 115, -17, -118, 115, 86, -41, 100};
        RIFTGATE_06_KORVAN_PLATEAU = new byte[]{-49, 111, 34, -128, -45, 70, -103, 47, -121, -104, -59, -112, 74, -41, -47, 82};
        RIFTGATE_06_TEMPLE_OSYR = new byte[]{41, 33, 83, 10, 99, 66, -72, -88, 91, -69, 26, -79, -62, 95, -82, -29};
        RIFTGATE_06_KORVAN_SANDS = new byte[]{66, -101, -17, 99, -74, 75, 50, -53, -126, 92, 38, -99, -72, 32, 111, -12};
        RIFTGATE_06_CAIRAN_DOCKS = new byte[]{13, -39, 116, -3, 59, 65, -74, 2, 12, -48, 80, -121, -113, -108, 105, -21};
        RIFTGATE_06_SUNBANE_OASIS = new byte[]{-9, -85, -69, 38, -68, 66, -44, -128, 21, -115, 56, -120, 115, -34, 45, -21};
        RIFTGATE_06_VANGUARD_THREE = new byte[]{-20, -2, 11, -48, 47, 78, -9, -68, -79, -117, 41, -124, -17, 48, 75, -64};
        RIFTGATE_06_RUINS_ABYD = new byte[]{-86, -82, -60, -122, -114, 79, 103, 73, -9, -54, -101, -107, 92, 11, -18, 110};
        RIFTGATE_06_INFERNAL_WASTES = new byte[]{35, -108, 43, -8, 69, 78, 28, -76, -34, 118, -82, -80, 87, -16, -16, 117};
        RIFTGATE_06_KORVAN_CITY = new byte[]{83, 46, -71, -96, -84, 67, 107, -64, -123, -74, -12, -84, 98, -13, -3, -64};
        RIFTGATE_06_ELDRITCH_SUN = new byte[]{-47, -30, 123, 15, -128, 76, 82, -69, -43, 57, 89, -100, -27, -26, -85, -27};
        RIFTGATE_06_ELDRITCH_GATE = new byte[]{121, 117, 47, -17, 48, 75, -35, 4, -52, 104, -39, -78, -76, 92, -74, 1};
        RIFTGATE_06_LOST_OASIS = new byte[]{-39, 44, 124, 44, -13, 68, -95, -41, 124, -2, 9, -87, 10, 108, -53, 58};
        RIFTGATE_07_LOST_OASIS = new byte[]{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
        UID_RIFT_01_DEVILS_CROSSING = new GDCharUID(GDCharTeleportList.RIFTGATE_01_DEVILS_CROSSING);
        UID_RIFT_01_LOWER_CROSSING = new GDCharUID(GDCharTeleportList.RIFTGATE_01_LOWER_CROSSING);
        UID_RIFT_01_WIGHTMIRE = new GDCharUID(GDCharTeleportList.RIFTGATE_01_WIGHTMIRE);
        UID_RIFT_01_FOGGY_BANK = new GDCharUID(GDCharTeleportList.RIFTGATE_01_FOGGY_BANK);
        UID_RIFT_01_FLOODED_PASSAGE = new GDCharUID(GDCharTeleportList.RIFTGATE_01_FLOODED_PASSAGE);
        UID_RIFT_01_BURRWITCH_OUTSKIRTS = new GDCharUID(GDCharTeleportList.RIFTGATE_01_BURRWITCH_OUTSKIRTS);
        UID_RIFT_01_BURRWITCH_VILLAGE = new GDCharUID(GDCharTeleportList.RIFTGATE_01_BURRWITCH_VILLAGE);
        UID_RIFT_01_WARDENS_CELLAR = new GDCharUID(GDCharTeleportList.RIFTGATE_01_WARDENS_CELLAR);
        UID_RIFT_01_UNDERGROUND_TRANSIT = new GDCharUID(GDCharTeleportList.RIFTGATE_01_UNDERGROUND_TRANSIT);
        UID_RIFT_01_WARDENS_LABORATORY = new GDCharUID(GDCharTeleportList.RIFTGATE_01_WARDENS_LABORATORY);
        UID_RIFT_02_ARKOVIAN_FOOTHILLS = new GDCharUID(GDCharTeleportList.RIFTGATE_02_ARKOVIAN_FOOTHILLS);
        UID_RIFT_02_OLD_ARKOVIA = new GDCharUID(GDCharTeleportList.RIFTGATE_02_OLD_ARKOVIA);
        UID_RIFT_02_CRONLEYS_HIDEOUT = new GDCharUID(GDCharTeleportList.RIFTGATE_02_CRONLEYS_HIDEOUT);
        UID_RIFT_02_TWIN_FALLS = new GDCharUID(GDCharTeleportList.RIFTGATE_02_TWIN_FALLS);
        UID_RIFT_02_BROKEN_HILLS = new GDCharUID(GDCharTeleportList.RIFTGATE_02_BROKEN_HILLS);
        UID_RIFT_02_SMUGGLERS_PASS = new GDCharUID(GDCharTeleportList.RIFTGATE_02_SMUGGLERS_PASS);
        UID_RIFT_03_DEADMANS_GULCH = new GDCharUID(GDCharTeleportList.RIFTGATE_03_DEADMANS_GULCH);
        UID_RIFT_03_PROSPECTORS_TRAIL = new GDCharUID(GDCharTeleportList.RIFTGATE_03_PROSPECTORS_TRAIL);
        UID_RIFT_03_PINE_BARRENS = new GDCharUID(GDCharTeleportList.RIFTGATE_03_PINE_BARRENS);
        UID_RIFT_03_HOMESTEAD = new GDCharUID(GDCharTeleportList.RIFTGATE_03_HOMESTEAD);
        UID_RIFT_03_ROTTING_CROPLANDS = new GDCharUID(GDCharTeleportList.RIFTGATE_03_ROTTING_CROPLANDS);
        UID_RIFT_03_SORROWS_BASTION = new GDCharUID(GDCharTeleportList.RIFTGATE_03_SORROWS_BASTION);
        UID_RIFT_03_BLOOD_GROVE = new GDCharUID(GDCharTeleportList.RIFTGATE_03_BLOOD_GROVE);
        UID_RIFT_03_DARKVALE_GATE = new GDCharUID(GDCharTeleportList.RIFTGATE_03_DARKVALE_GATE);
        UID_RIFT_04_ASTERKARN_MOUNTAINS = new GDCharUID(GDCharTeleportList.RIFTGATE_04_ASTERKARN_MOUNTAINS);
        UID_RIFT_04_ASTERKARN_ROAD = new GDCharUID(GDCharTeleportList.RIFTGATE_04_ASTERKARN_ROAD);
        UID_RIFT_04_ASTERKARN_VALLEY = new GDCharUID(GDCharTeleportList.RIFTGATE_04_ASTERKARN_VALLEY);
        UID_RIFT_04_FORT_IKON = new GDCharUID(GDCharTeleportList.RIFTGATE_04_FORT_IKON);
        UID_RIFT_04_GATES_OF_NECROPOLIS = new GDCharUID(GDCharTeleportList.RIFTGATE_04_GATES_OF_NECROPOLIS);
        UID_RIFT_04_NECROPOLIS_INTERIOR = new GDCharUID(GDCharTeleportList.RIFTGATE_04_NECROPOLIS_INTERIOR);
        UID_RIFT_05_GLOOMWALD = new GDCharUID(GDCharTeleportList.RIFTGATE_05_GLOOMWALD);
        UID_RIFT_05_GLOOMWALD_CROSSING = new GDCharUID(GDCharTeleportList.RIFTGATE_05_GLOOMWALD_CROSSING);
        UID_RIFT_05_COVENS_REFUGE = new GDCharUID(GDCharTeleportList.RIFTGATE_05_COVENS_REFUGE);
        UID_RIFT_05_UGDENBOG = new GDCharUID(GDCharTeleportList.RIFTGATE_05_UGDENBOG);
        UID_RIFT_05_BARROWHOLM = new GDCharUID(GDCharTeleportList.RIFTGATE_05_BARROWHOLM);
        UID_RIFT_05_LONE_WATCH = new GDCharUID(GDCharTeleportList.RIFTGATE_05_LONE_WATCH);
        UID_RIFT_05_MALMOUTH_OUTSKIRTS = new GDCharUID(GDCharTeleportList.RIFTGATE_05_MALMOUTH_OUTSKIRTS);
        UID_RIFT_05_MALMOUTH_SEWERS = new GDCharUID(GDCharTeleportList.RIFTGATE_05_MALMOUTH_SEWERS);
        UID_RIFT_05_MALMOUTH_STEELCAP = new GDCharUID(GDCharTeleportList.RIFTGATE_05_MALMOUTH_STEELCAP);
        UID_RIFT_05_MALMOUTH_CROWN_HILL = new GDCharUID(GDCharTeleportList.RIFTGATE_05_MALMOUTH_CROWN_HILL);
        UID_RIFT_06_CONCLAVE_THREE = new GDCharUID(GDCharTeleportList.RIFTGATE_06_CONCLAVE_THREE);
        UID_RIFT_06_KORVAN_PLATEAU = new GDCharUID(GDCharTeleportList.RIFTGATE_06_KORVAN_PLATEAU);
        UID_RIFT_06_TEMPLE_OSYR = new GDCharUID(GDCharTeleportList.RIFTGATE_06_TEMPLE_OSYR);
        UID_RIFT_06_KORVAN_SANDS = new GDCharUID(GDCharTeleportList.RIFTGATE_06_KORVAN_SANDS);
        UID_RIFT_06_CAIRAN_DOCKS = new GDCharUID(GDCharTeleportList.RIFTGATE_06_CAIRAN_DOCKS);
        UID_RIFT_06_SUNBANE_OASIS = new GDCharUID(GDCharTeleportList.RIFTGATE_06_SUNBANE_OASIS);
        UID_RIFT_06_VANGUARD_THREE = new GDCharUID(GDCharTeleportList.RIFTGATE_06_VANGUARD_THREE);
        UID_RIFT_06_RUINS_ABYD = new GDCharUID(GDCharTeleportList.RIFTGATE_06_RUINS_ABYD);
        UID_RIFT_06_INFERNAL_WASTES = new GDCharUID(GDCharTeleportList.RIFTGATE_06_INFERNAL_WASTES);
        UID_RIFT_06_KORVAN_CITY = new GDCharUID(GDCharTeleportList.RIFTGATE_06_KORVAN_CITY);
        UID_RIFT_06_ELDRITCH_SUN = new GDCharUID(GDCharTeleportList.RIFTGATE_06_ELDRITCH_SUN);
        UID_RIFT_06_ELDRITCH_GATE = new GDCharUID(GDCharTeleportList.RIFTGATE_06_ELDRITCH_GATE);
        UID_RIFT_06_LOST_OASIS = new GDCharUID(GDCharTeleportList.RIFTGATE_06_LOST_OASIS);
        UID_RIFT_07_FROSTRVEIL_HIGHLANDS = new GDCharUID(GDCharTeleportList.RIFTGATE_07_LOST_OASIS);
        UID_RIFT_07_ICEBOUND_PASSAGE = new GDCharUID(GDCharTeleportList.RIFTGATE_07_LOST_OASIS);
        UID_RIFT_07_FREYOLL_VALLEY = new GDCharUID(GDCharTeleportList.RIFTGATE_07_LOST_OASIS);
        UID_RIFT_07_KURNHOLD = new GDCharUID(GDCharTeleportList.RIFTGATE_07_LOST_OASIS);
        UID_RIFT_07_ULOS_SPRINGS = new GDCharUID(GDCharTeleportList.RIFTGATE_07_LOST_OASIS);
        UID_RIFT_07_DREAD_WASTES = new GDCharUID(GDCharTeleportList.RIFTGATE_07_LOST_OASIS);
        UID_RIFT_07_BLOOD_FIELDS = new GDCharUID(GDCharTeleportList.RIFTGATE_07_LOST_OASIS);
        UID_RIFT_07_GLACIERS_EDGE = new GDCharUID(GDCharTeleportList.RIFTGATE_07_LOST_OASIS);
        UID_RIFT_07_AURORA_PEAKS = new GDCharUID(GDCharTeleportList.RIFTGATE_07_LOST_OASIS);
        UID_RIFT_07_GLACIAL_GROTTO = new GDCharUID(GDCharTeleportList.RIFTGATE_07_LOST_OASIS);
        UID_RIFT_07_ROOF_WORLDN = new GDCharUID(GDCharTeleportList.RIFTGATE_07_LOST_OASIS);
        UID_RIFT_07_DRANG_SUL_LOW = new GDCharUID(GDCharTeleportList.RIFTGATE_07_LOST_OASIS);
        UID_RIFT_07_DRANG_GAL_HIGH = new GDCharUID(GDCharTeleportList.RIFTGATE_07_LOST_OASIS);
        RIFTGATE_ROT_01_ROGUE_ENCAMPMENT = new byte[]{-97, 20, -26, -22, -5, 68, 111, 27, -25, 66, 53, -126, 83, 113, -117, -114};
        RIFTGATE_ROT_01_COLD_PLAINS = new byte[]{4, 81, 1, 66, -94, 73, -21, -30, 121, 16, -58, -111, -6, 54, 114, -78};
        RIFTGATE_ROT_01_STONY_FIELD = new byte[]{19, 21, -34, -49, -4, 68, -29, -117, 25, -109, -107, -80, 0, 47, 78, 75};
        RIFTGATE_ROT_01_DARK_WOOD = new byte[]{75, -55, -96, -44, -128, 70, -52, 75, -6, -125, 72, -110, -39, 2, 75, 20};
        RIFTGATE_ROT_01_BLACK_MARSH = new byte[]{99, 56, -17, -11, -101, 69, 73, 90, 52, -53, -112, -81, 1, -83, 76, -117};
        RIFTGATE_ROT_01_CLOISTER_OUTER = new byte[]{94, -26, -92, -122, 5, 71, 39, 30, -73, 92, -37, -90, 105, 68, 101, 57};
        RIFTGATE_ROT_01_JAIL = new byte[]{-44, -85, 96, -62, -13, 72, -69, 108, 90, 2, 93, -71, 38, 45, -33, -1};
        RIFTGATE_ROT_01_CLOISTER_INNER = new byte[]{-83, -73, 66, -124, -106, 79, 60, 45, -88, -17, -115, -93, -89, 74, -8, 98};
        RIFTGATE_ROT_01_CATACOMBS = new byte[]{23, 122, -19, -95, -111, 64, 12, 94, 116, -71, -23, -109, 63, -78, -115, 27};
        RIFTGATE_ROT_02_LUT_GHOLEIN = new byte[]{-59, -43, -64, 118, 104, 66, 101, -12, -69, 64, 18, -109, -46, -126, 42, 79};
        RIFTGATE_ROT_02_SEWERS = new byte[]{-89, 38, -63, 62, -52, 66, -24, -47, -121, 78, -50, -95, -97, -103, 79, -118};
        RIFTGATE_ROT_02_DRY_HILLS = new byte[]{23, 92, -14, -106, 48, 71, 101, 99, 59, -60, 32, -75, -51, 76, -8, 67};
        RIFTGATE_ROT_02_HALLS_DEAD = new byte[]{72, -30, -92, -20, 36, 68, 71, -12, 30, 60, -42, -93, 20, -64, 27, -2};
        RIFTGATE_ROT_02_FAR_OASIS = new byte[]{-23, 31, 65, 115, 110, 67, -76, -17, -91, 81, -59, -95, -125, -28, 41, 4};
        RIFTGATE_ROT_02_LOST_CITY = new byte[]{-66, -89, -16, -91, 43, 76, -116, 96, -4, 91, -16, -105, -124, 33, -79, 71};
        RIFTGATE_ROT_02_PALACE_CELLAR = new byte[]{54, -50, 96, -63, 22, 67, -94, -27, 126, -126, -88, -102, -61, 110, -47, 24};
        RIFTGATE_ROT_02_ARCANE_SANCTUARY = new byte[]{-46, -5, -15, -87, -74, 64, -87, -117, -65, 78, -65, -123, -56, -103, 114, 9};
        RIFTGATE_ROT_02_CANYON_MAGI = new byte[]{116, -56, -57, -54, 24, 67, 116, -124, 78, 90, -85, -76, -88, -10, 4, 101};
        RIFTGATE_ROT_03_KURAST_DOCKS = new byte[]{17, 65, 19, -39, 27, 64, -123, 56, 46, -50, 26, -126, 107, -23, -31, 16};
        RIFTGATE_ROT_03_SPIDER_FOREST = new byte[]{-36, -96, -115, 70, -42, 72, -89, 97, -57, 75, 23, -118, 75, -22, 29, 51};
        RIFTGATE_ROT_03_GREAT_MARSH = new byte[]{7, 35, -88, -80, 62, 79, -127, -62, -80, -103, -68, -84, -76, -84, -71, -96};
        RIFTGATE_ROT_03_FLAYER_JUNGLE = new byte[]{37, -47, -128, -28, -55, 64, 95, 34, 106, 85, 124, -88, -74, 34, -64, 17};
        RIFTGATE_ROT_03_KURAST_LOWER = new byte[]{118, -32, 108, -13, -4, 67, -43, -108, 101, -22, 113, -117, 26, -72, 4, -32};
        RIFTGATE_ROT_03_KURAST_BAZAAR = new byte[]{41, 19, 91, -59, -76, 70, -96, -113, 70, -82, 68, -88, -53, -82, 8, -50};
        RIFTGATE_ROT_03_KURAST_UPPER = new byte[]{72, 103, 22, 90, -90, 64, 85, 2, -126, 45, -70, -101, 47, -122, -72, 114};
        RIFTGATE_ROT_03_TRAVINCAL = new byte[]{-1, 124, 78, -102, -121, 64, 0, 83, 119, -87, -61, -110, -32, 7, 16, -97};
        RIFTGATE_ROT_03_DURANCE_HATE = new byte[]{-107, -67, -110, -27, 82, 73, -44, 113, -19, -105, -49, -70, -14, 58, -92, 6};
        RIFTGATE_ROT_04_PANDEMONIUM_FORTRESS = new byte[]{80, -116, -33, 67, 5, 72, -9, 54, -118, -89, 25, -114, -52, -22, -76, -97};
        RIFTGATE_ROT_04_PLAINS_DESPAIR = new byte[]{8, -99, 86, -79, 68, 77, -14, 64, 85, -5, 103, -67, 11, -13, -105, 120};
        RIFTGATE_ROT_04_CITY_DAMNED = new byte[]{34, 55, 28, 124, -99, 75, -72, 47, -128, -43, -89, -81, 7, 111, 54, 93};
        RIFTGATE_ROT_04_RIVER_FLAME = new byte[]{-120, -82, -8, -47, 118, 67, 14, -39, 30, -6, -77, -108, 86, -58, 56, -61};
        RIFTGATE_ROT_05_HARROGATH = new byte[]{-23, 100, -25, 78, -126, 64, 31, 50, 125, -30, 57, -92, -66, -70, -11, -79};
        RIFTGATE_ROT_05_FRIGID_HIGHLANDS = new byte[]{110, 30, 53, 113, -67, 78, 59, 48, -58, 103, 101, -70, 78, 41, 13, -106};
        RIFTGATE_ROT_05_ARREAT_PLATEAU = new byte[]{-112, 60, 101, -110, -111, 70, 45, -79, -89, -75, -29, -106, -95, 102, 119, -82};
        RIFTGATE_ROT_05_CRYSTALLINE_PASSAGE = new byte[]{88, 84, -123, 27, -120, 78, -103, 78, -81, -40, -8, -117, 69, -65, -62, 109};
        RIFTGATE_ROT_05_HALLS_PAIN = new byte[]{-7, 22, -48, 106, 12, 78, -54, 120, 0, 3, -42, -66, 62, -120, -81, 117};
        RIFTGATE_ROT_05_GLACIAL_TRAIL = new byte[]{90, 93, 95, -106, 48, 76, 52, -101, -1, 105, 83, -105, -105, -33, -115, 68};
        RIFTGATE_ROT_05_FROZEN_TUNDRA = new byte[]{50, -126, 66, 106, -39, 66, 53, 112, -40, 1, 89, -73, -50, 73, -2, 10};
        RIFTGATE_ROT_05_ANCIENTS_WAY = new byte[]{-25, 117, -58, -112, 1, 79, 22, 31, -126, -84, 81, -108, 69, -93, 47, -82};
        RIFTGATE_ROT_05_WORLDSTONE_KEEP = new byte[]{47, 125, -46, 81, -58, 70, -110, -13, -79, 102, 75, -106, -123, -13, -68, 127};
        RIFTGATE_ROT_06_SHATTERED_CONCLAVE = new byte[]{28, 29, 28, 105, 11, 77, 25, 66, 10, -94, 10, -69, 126, 50, 75, 48};
        RIFTGATE_ROT_06_TRISTRAM = new byte[]{-3, -5, 72, -23, -110, 68, 103, 99, -90, -37, 83, -88, 93, -23, 78, -63};
        RIFTGATE_ROT_06_LEVEL_02 = new byte[]{-104, -97, -123, 103, 91, 77, 105, -119, 126, 97, -70, -81, -36, -68, 38, -63};
        RIFTGATE_ROT_06_LEVEL_04 = new byte[]{68, -70, -37, 69, -67, 70, -26, -87, -41, -128, -84, -72, -48, -28, -72, 84};
        RIFTGATE_ROT_06_LEVEL_06 = new byte[]{105, 107, -95, -24, 16, 78, -33, -67, 44, 1, -112, -77, -14, -99, -1, -120};
        RIFTGATE_ROT_06_LEVEL_08 = new byte[]{-3, 101, 81, 77, -24, 66, -29, -1, -76, 70, -80, -88, -11, -23, 63, -3};
        RIFTGATE_ROT_06_LEVEL_10 = new byte[]{78, -69, 46, 123, -75, 71, -126, 45, 60, 26, -96, -89, -33, -80, 97, -96};
        RIFTGATE_ROT_06_LEVEL_12 = new byte[]{-52, 94, -27, -72, 91, 67, 38, 10, -39, -77, -74, -87, -89, 19, -18, -111};
        RIFTGATE_ROT_06_LEVEL_14 = new byte[]{121, -71, 63, -120, -108, 64, 8, -16, 69, -126, -88, -127, -36, -80, -1, -28};
        RIFTGATE_ROT_06_LEVEL_16 = new byte[]{15, 47, 16, 72, 37, 79, 69, 42, -65, 75, 33, -110, 93, 69, -71, 50};
        RIFTGATE_ROT_06_HORADRIM_TOMB = new byte[]{118, -90, -121, 80, -112, 79, -109, -24, -119, 12, 119, -77, 103, 109, -93, 48};
        UID_RIFT_ROT_01_ROGUE_ENCAMPMENT = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_01_ROGUE_ENCAMPMENT);
        UID_RIFT_ROT_01_COLD_PLAINS = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_01_COLD_PLAINS);
        UID_RIFT_ROT_01_STONY_FIELD = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_01_STONY_FIELD);
        UID_RIFT_ROT_01_DARK_WOOD = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_01_DARK_WOOD);
        UID_RIFT_ROT_01_BLACK_MARSH = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_01_BLACK_MARSH);
        UID_RIFT_ROT_01_CLOISTER_OUTER = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_01_CLOISTER_OUTER);
        UID_RIFT_ROT_01_JAIL = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_01_JAIL);
        UID_RIFT_ROT_01_CLOISTER_INNER = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_01_CLOISTER_INNER);
        UID_RIFT_ROT_01_CATACOMBS = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_01_CATACOMBS);
        UID_RIFT_ROT_02_LUT_GHOLEIN = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_02_LUT_GHOLEIN);
        UID_RIFT_ROT_02_SEWERS = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_02_SEWERS);
        UID_RIFT_ROT_02_DRY_HILLS = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_02_DRY_HILLS);
        UID_RIFT_ROT_02_HALLS_DEAD = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_02_HALLS_DEAD);
        UID_RIFT_ROT_02_FAR_OASIS = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_02_FAR_OASIS);
        UID_RIFT_ROT_02_LOST_CITY = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_02_LOST_CITY);
        UID_RIFT_ROT_02_PALACE_CELLAR = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_02_PALACE_CELLAR);
        UID_RIFT_ROT_02_ARCANE_SANCTUARY = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_02_ARCANE_SANCTUARY);
        UID_RIFT_ROT_02_CANYON_MAGI = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_02_CANYON_MAGI);
        UID_RIFT_ROT_03_KURAST_DOCKS = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_03_KURAST_DOCKS);
        UID_RIFT_ROT_03_SPIDER_FOREST = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_03_SPIDER_FOREST);
        UID_RIFT_ROT_03_GREAT_MARSH = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_03_GREAT_MARSH);
        UID_RIFT_ROT_03_FLAYER_JUNGLE = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_03_FLAYER_JUNGLE);
        UID_RIFT_ROT_03_KURAST_LOWER = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_03_KURAST_LOWER);
        UID_RIFT_ROT_03_KURAST_BAZAAR = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_03_KURAST_BAZAAR);
        UID_RIFT_ROT_03_KURAST_UPPER = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_03_KURAST_UPPER);
        UID_RIFT_ROT_03_TRAVINCAL = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_03_TRAVINCAL);
        UID_RIFT_ROT_03_DURANCE_HATE = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_03_DURANCE_HATE);
        UID_RIFT_ROT_04_PANDEMONIUM_FORTRESS = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_04_PANDEMONIUM_FORTRESS);
        UID_RIFT_ROT_04_PLAINS_DESPAIR = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_04_PLAINS_DESPAIR);
        UID_RIFT_ROT_04_CITY_DAMNED = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_04_CITY_DAMNED);
        UID_RIFT_ROT_04_RIVER_FLAME = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_04_RIVER_FLAME);
        UID_RIFT_ROT_05_HARROGATH = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_05_HARROGATH);
        UID_RIFT_ROT_05_FRIGID_HIGHLANDS = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_05_FRIGID_HIGHLANDS);
        UID_RIFT_ROT_05_ARREAT_PLATEAU = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_05_ARREAT_PLATEAU);
        UID_RIFT_ROT_05_CRYSTALLINE_PASSAGE = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_05_CRYSTALLINE_PASSAGE);
        UID_RIFT_ROT_05_HALLS_PAIN = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_05_HALLS_PAIN);
        UID_RIFT_ROT_05_GLACIAL_TRAIL = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_05_GLACIAL_TRAIL);
        UID_RIFT_ROT_05_FROZEN_TUNDRA = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_05_FROZEN_TUNDRA);
        UID_RIFT_ROT_05_ANCIENTS_WAY = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_05_ANCIENTS_WAY);
        UID_RIFT_ROT_05_WORLDSTONE_KEEP = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_05_WORLDSTONE_KEEP);
        UID_RIFT_ROT_06_SHATTERED_CONCLAVE = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_06_SHATTERED_CONCLAVE);
        UID_RIFT_ROT_06_TRISTRAM = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_06_TRISTRAM);
        UID_RIFT_ROT_06_LEVEL_02 = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_06_LEVEL_02);
        UID_RIFT_ROT_06_LEVEL_04 = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_06_LEVEL_04);
        UID_RIFT_ROT_06_LEVEL_06 = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_06_LEVEL_06);
        UID_RIFT_ROT_06_LEVEL_08 = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_06_LEVEL_08);
        UID_RIFT_ROT_06_LEVEL_10 = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_06_LEVEL_10);
        UID_RIFT_ROT_06_LEVEL_12 = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_06_LEVEL_12);
        UID_RIFT_ROT_06_LEVEL_14 = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_06_LEVEL_14);
        UID_RIFT_ROT_06_LEVEL_16 = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_06_LEVEL_16);
        UID_RIFT_ROT_06_HORADRIM_TOMB = new GDCharUID(GDCharTeleportList.RIFTGATE_ROT_06_HORADRIM_TOMB);
    }

    private int version;
    private ArrayList<List<GDCharUID>> uidLists;
    private GDChar gdc;
    private boolean changed;

    public GDCharTeleportList(final GDChar gdc) {
        final int size = 3;
        this.uidLists = new ArrayList<List<GDCharUID>>(size);
        for (int i = 0; i < size; ++i) {
            this.uidLists.add(new LinkedList<GDCharUID>());
        }
        this.gdc = gdc;
    }

    public List<GDCharUID> getRiftList(final int difficulty) {
        final List<GDCharUID> list = new LinkedList<GDCharUID>();
        if (difficulty < 0 || difficulty > 2) {
            return list;
        }
        return this.uidLists.get(difficulty);
    }

    public boolean hasChanged() {
        return this.changed;
    }

    public void setRiftList(final int difficulty, final List<GDCharUID> addList, final List<GDCharUID> removeList) {
        if (difficulty < 0 || difficulty > 2) {
            return;
        }
        final int index = difficulty;
        final List<GDCharUID> riftgates = this.uidLists.get(index);
        final List<GDCharUID> newList = new LinkedList<GDCharUID>();
        for (final GDCharUID uid : riftgates) {
            if (!removeList.contains(uid)) {
                newList.add(uid);
            } else {
                this.changed = true;
            }
        }
        for (final GDCharUID uid : addList) {
            if (!newList.contains(uid)) {
                newList.add(uid);
                this.changed = true;
            }
        }
        this.uidLists.set(index, newList);
    }

    public void read() throws IOException {
        int val = 0;
        final GDReader.Block block = new GDReader.Block();
        val = GDReader.readBlockStart(block);
        if (val != 6) {
            throw new FileVersionException(GDMsgFormatter.getString(GDMsgFormatter.rbMsg, "ERR_UNSUPPORTED_VERSION"));
        }
        this.version = GDReader.readEncInt(true);
        if (this.version != 1) {
            throw new FileVersionException(GDMsgFormatter.getString(GDMsgFormatter.rbMsg, "ERR_UNSUPPORTED_VERSION"));
        }
        for (int i = 0; i < this.uidLists.size(); ++i) {
            GDChar.readUIDList(this.uidLists.get(i));
        }
        GDReader.readBlockEnd(block);
        this.changed = false;
    }

    public void write() throws IOException {
        final GDReader.Block block = new GDReader.Block();
        GDWriter.writeBlockStart(block, 6);
        GDWriter.writeInt(this.version);
        for (int i = 0; i < this.uidLists.size(); ++i) {
            GDChar.writeUIDList(this.uidLists.get(i));
        }
        GDWriter.writeBlockEnd(block);
        this.changed = false;
    }

    public int getByteSize() {
        int size = 0;
        size += 4;
        size += 4;
        size += 4;
        for (int i = 0; i < this.uidLists.size(); ++i) {
            size += 4;
            size += this.uidLists.get(i).size() * GDCharUID.getByteSize();
        }
        size += 4;
        return size;
    }

    public void print() {
        for (int i = 0; i < this.uidLists.size(); ++i) {
            System.out.println("Index : " + Integer.toString(i));
            for (final GDCharUID uid : this.uidLists.get(i)) {
                uid.println();
            }
            System.out.println();
        }
    }
}
